pow.ivyclient
Class AcNetIdStorage

java.lang.Object
  extended by pow.ivyclient.AcNetIdStorage

public class AcNetIdStorage
extends java.lang.Object

this structure memorize all the drone which exist on the ivy bus. A drone has two identities. One on its ivy drone which can be the same as another drone on a different ivy bus. The second identifier is the I.D. of the drone on the web. This I.D. is unique. So a link has to be done between these two kind of id.

Author:
genin

Constructor Summary
AcNetIdStorage(int ii, fr.dgac.ivy.Ivy b, java.lang.String u, int maxAC, java.util.concurrent.ConcurrentHashMap<java.lang.String,AcStatus> states)
           
 
Method Summary
 java.lang.String getAcIvyId(int idOnWeb)
          do the link between the id of the drone on the web and is true id on its ivy bus
 AcNetId getAcNetId(java.lang.String idOnIvy)
          Return the identity object of the drone on the web
 java.lang.String getNewDroneWebId(java.lang.String IvyDroneId)
          ask a unique new web id to the server for a new drone detected on the ivy bus
 void seekAcNetId(java.lang.String s)
          search the drone net id of a drone from its ivy id if the drone is a new one, a new net id is requested to the server
 boolean uploadConfFile(AcNetId ac)
          upload de fichier de conf sur le serveur verifier que ca marche sur long fichier si probleme changer avec : factory.setSizeThreshold(yourMaxMemorySize); factory.setRepository(yourTempDirectory); upload.setSizeMax(yourMaxRequestSize);
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcNetIdStorage

public AcNetIdStorage(int ii,
                      fr.dgac.ivy.Ivy b,
                      java.lang.String u,
                      int maxAC,
                      java.util.concurrent.ConcurrentHashMap<java.lang.String,AcStatus> states)
Method Detail

getAcNetId

public AcNetId getAcNetId(java.lang.String idOnIvy)
Return the identity object of the drone on the web

Parameters:
idOnIvy -
Returns:
the identity of the drone on the web or null if it is not present

getAcIvyId

public java.lang.String getAcIvyId(int idOnWeb)
do the link between the id of the drone on the web and is true id on its ivy bus

Parameters:
idOnWeb - the id of the drone on the web
Returns:
the id of the drone on the ivy bus

seekAcNetId

public void seekAcNetId(java.lang.String s)
search the drone net id of a drone from its ivy id if the drone is a new one, a new net id is requested to the server

Parameters:
s - the ivy id of the drone

uploadConfFile

public boolean uploadConfFile(AcNetId ac)
                       throws java.io.FileNotFoundException
upload de fichier de conf sur le serveur verifier que ca marche sur long fichier si probleme changer avec : factory.setSizeThreshold(yourMaxMemorySize); factory.setRepository(yourTempDirectory); upload.setSizeMax(yourMaxRequestSize);

Parameters:
ac - the information object about the drone
Throws:
java.lang.InterruptedException
java.io.FileNotFoundException

getNewDroneWebId

public java.lang.String getNewDroneWebId(java.lang.String IvyDroneId)
                                  throws IvyConnectionExeption
ask a unique new web id to the server for a new drone detected on the ivy bus

Parameters:
IvyDroneId - the drone id on ivy
Returns:
the new web drone id
Throws:
IvyConnectionExeption